package cn.bellychang.ood.ocp.good;

/**
 * @author ChangLiang
 * @date 2020/5/12
 */
public class AppenderFactory {

    public static Appender createAppender(int type) {
        if (type == 1) {
            return new EmailAppender();
        }
        if (type == 2) {
            return new SmsAppender();
        }
        if (type == 3) {
            return new PrintAppender();
        }
        throw new RuntimeException("appender type: " + type + " not support currently");
    }
}
